package com.ffapp.demo.chat.stomp;

import my.LogUtil;
import ua.naiksoftware.stomp.StompClient;


public class StompUtils {
    public static final String TAG = "Stomp";

    @SuppressWarnings({"ResultOfMethodCallIgnored", "CheckResult"})
    public static void lifecycle(StompClient stompClient) {
        stompClient.lifecycle().subscribe(lifecycleEvent -> {
            switch (lifecycleEvent.getType()) {
                case OPENED:
                    LogUtil.i(TAG, "Stomp connection opened");
                    break;
                case ERROR:
                    LogUtil.i(TAG, "Error---"+lifecycleEvent.getException());
                    break;

                case CLOSED:
                    LogUtil.i(TAG, "Stomp connection closed");
                    break;
            }
        });
    }
}
